//
//  LGAddAnomalyView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/8/2.
//

#import "LGAddAnomalyLineView.h"

@interface LGAddAnomalyLineView()
/**   */
@property (nonatomic , strong)UIImageView *iconView;



@end

@implementation LGAddAnomalyLineView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}


-(void)createSubView{
    [self addSubview:self.iconView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.contentTF];
    [self addSubview:self.lineView];
    [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(viewPix(16));
        make.width.height.equalTo(@(viewPix(12)));
        make.centerY.equalTo(self);
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView.mas_right).offset(viewPix(5));
        make.width.equalTo(@(viewPix(70)));
        make.centerY.equalTo(self);
    }];
    [self.contentTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-viewPix(13));
        make.left.equalTo(self.titleLabel.mas_right);
        make.top.bottom.equalTo(self);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(viewPix(16));
        make.right.equalTo(self).offset(-viewPix(16));
        make.bottom.equalTo(self);
        make.height.equalTo(@(0.5));
    }];
}

-(UIImageView *)iconView{
    if(!_iconView){
        _iconView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"必选项"]];
    }
    return _iconView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _titleLabel;
}

-(UITextField *)contentTF{
    if(!_contentTF){
        _contentTF = [[UITextField alloc]init];
        _contentTF.tintColor = [UIColor colorWithString:@"#333333"];
        _contentTF.textColor = [UIColor colorWithString:@"#333333"];
        _contentTF.textAlignment = NSTextAlignmentRight;
        _contentTF.font = LGFont(15);
    }
    return _contentTF;
}

-(UIView *)lineView{
    if(!_lineView){
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithString:@"#E1E1E1"];
    }
    return _lineView;
}

@end
